<?php
$userDao = Vega_Dao::factory('Mobitv_Admin_Admin');
$userId = $_SESSION['userid'];
$perm = $userDao->getPermission($userId, 'schedule:index');

$perm['group_permission'] = is_null($perm['group_permission']) ? 0 : $perm['group_permission'];
$allow = is_null($perm['user_permission']) ? $perm['group_permission'] : $perm['user_permission'];

?>

<div id="top-menu">
    <div id="top-menu1">
        <ul id="menu">
        <li><a href="/">Trang chủ</a></li>
        <li <?php echo ($_module=='myvideo') ? 'class="active"' : '' ?>><a href="/myvideo">Video</a>
            <ul>
                <li><a href="/myvideo">Video của tôi</a></li>
                <li><a href="/myvideo">Thống kê</a></li>
            </ul>
        </li>
        <?php if ($allow): ?>
        <li <?php echo ($_module=='schedule') ? 'class="active"' : '' ?>><a href="/schedule">Lịch phát sóng</a></li>
        <?php endif; ?>
        <li <?php echo ($_action=='admin/detail') ? 'class="active"' : '' ?>><a href="/admin/detail">Cá nhân</a></li>
        </ul>
    </div>
    <div id="top-menu2">
        <a href="/video/upload" class="upload">Đăng video</a>
    </div>
    <div class="clearfloat"></div>
</div>